package com.webside.series.service.impl;

import java.util.HashMap;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.webside.base.baseservice.impl.AbstractService;
import com.webside.series.mapper.SeriesMapper;
import com.webside.series.model.Bdictionary;
import com.webside.series.model.SeriesEntity;
import com.webside.series.service.SeriesService;
import com.webside.util.PageUtil;

@Service("seriesService")
public class SeriesServiceImpl extends AbstractService<SeriesEntity, Long> implements SeriesService {

	@Autowired
	private SeriesMapper seriesMapper;

	// 这句必须要加上。不然会报空指针异常，因为在实际调用的时候不是BaseMapper调用，而是具体的mapper，这里为userMapper
	@Autowired
	public void setBaseMapper() {
		super.setBaseMapper(seriesMapper);
	}

	@Override
	public List<SeriesEntity> queryListByName(String seriesName) {
		return seriesMapper.queryListByName(seriesName);
	};

	@Override
	public List<SeriesEntity> typeByAllselect() {
		// TODO Auto-generated method stub
		return seriesMapper.typeByAllselect();
	}

	@Override
	public int updateSetSum(SeriesEntity record) {
		// TODO Auto-generated method stub
		return seriesMapper.updateSetSum(record);
	}

	@Override
	public int updateOnline(List<Long> roleIds) {
		// TODO Auto-generated method stub
		return seriesMapper.updateOnline(roleIds);
	}

	@Override
	public int updateOffline(List<Long> roleIds) {
		// TODO Auto-generated method stub
		return seriesMapper.updateOffline(roleIds);
	}

	// 根据参查询符合条件的未处理剧集 (lpz)
	// @Override
	// public List<SeriesEntity> SelectDealSeriesList(SeriesEntity record) {
	// // TODO Auto-generated method stub
	// return seriesMapper.SelectDealSeriesList(record);
	// }
	@Override
	public int updateDispose(List<Long> roleIds) {
		// TODO Auto-generated method stub
		return seriesMapper.updateDispose(roleIds);
	}
	/**
	 * 查询总数
	 */
	@Override
	public int countAll() {
		// TODO Auto-generated method stub
		return seriesMapper.queryAllSeries();
	}

	@Override
	public List<HashMap<String, Object>> querySeries(PageUtil pageUtil, String sort, String code) {
		// TODO Auto-generated method stub
		String seriesName  = sort;
		return seriesMapper.querySeriesMap(pageUtil,seriesName,code);
	}

}
